package com.dong.springbootdruidsingle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.sql.DataSource;

@SpringBootApplication
public class SpringBootDruidSingleApplication implements CommandLineRunner {

    private Logger logger = LoggerFactory.getLogger(SpringBootDruidSingleApplication.class);

    @Autowired
    DataSource dataSource;

    public static void main(String[] args) {
        SpringApplication.run(SpringBootDruidSingleApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        logger.info("【run】【durid获取数据源:{}】", dataSource.getClass());

    }
}
